package com.health.widget;

import android.content.Context;
import android.util.AttributeSet;
import android.view.MotionEvent;
import android.widget.ViewFlipper;

public class MyViewPager extends ViewFlipper {

		private boolean mDisableSroll = true;

		public MyViewPager(Context context) {
			super(context);
		}

		public MyViewPager(Context context, AttributeSet attrs) {
			super(context, attrs);
		}

		public void setDisableScroll(boolean bDisable) {
			mDisableSroll = bDisable;
		}

		@Override
		public boolean onInterceptTouchEvent(MotionEvent ev) {
			if (mDisableSroll) {
				return false;
			}
			return super.onInterceptTouchEvent(ev);
		}

		@Override
		public boolean onTouchEvent(MotionEvent ev) {
			if (mDisableSroll) {
				return false;
			}
			return super.onTouchEvent(ev);
		}

	}